package cn.rengy.web.framework.wxmp.token;
/**
 * 保存、加锁、刷新、删除
 * 时使用的key
 * @author rengy
 *
 */
public interface TokenKeyService {
	public static final String ACCESS_TOKEN_KEY="wx_access_token::";
	
	public static final String JSAPITICKET_KEY="wx_jsapi_ticket::";
	
	public static final String AccessToken_LOCK_KEY="lock::wxAppAccessToken::";
	public static final String JsApiTicket_LOCK_KEY="lock::wxAppJsApiTicket::";
	
	public static String getAccessTokenLockKey(String appid){
		return AccessToken_LOCK_KEY.concat(appid);
	}
	public static String getJsApiTicketLockKey(String appid){
		return JsApiTicket_LOCK_KEY.concat(appid);
	}
	public static String getAccessTokenKey(String appid){
		return ACCESS_TOKEN_KEY.concat(appid);
	}
	public static String getJsApiTicketKey(String appid){
		return JSAPITICKET_KEY.concat(appid);
	}
	/**
	 * 加锁时使用的key
	 * @param accessToken
	 * @return
	 */
	String getLockKey(String appid);
	/**
	 * 保存到redis时使用的key
	 * @param accessToken
	 * @return
	 */
	String getAccessKey(String appid);
	
}
